
<?php
/*
 * Created on May 14, 2009
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 ?>

<?php
// echo $this->ckeditor->editor("my_editor");
$config['toolbar'] = array(
	      array( 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike' ),
	      array( 'Image', 'Link', 'Unlink', 'Anchor' )
	  );
 //$fckEditor = fckEditor('txtViDescription', $product->vi_description);
  $fckEditor = '';// $this->ckeditor->editor("my_editor", "default value", $config);
 //$CI->fckeditor->CreateHtml() ;
?>
  <?php  $this->load->view('admin/product/link_bar');?>
 <div class="box_function">

<?php //echo $legend_text ?>
<?php echo $error_message?>
<form action="<?php echo base_url()?>admin/product/save" method="post" enctype="multipart/form-data">
	 <table width="747" border="0" cellpadding="0" cellspacing="0" class="listproduct" id="listproduct">

	<tr>

		<td class="product">
		<div>
		<?php echo lang('product_code')?>
		</div>
		<input type="text" class="text" name="txtCode" id="txtCode" value="<?php echo $product->code?>" style="width: 150px;" maxlength="60" /> <?php echo lang('invalid_characters')?>
		</td>
	</tr>
	<tr>

		<td class="product">
		<div>
		<?php echo lang('category')?>
		</div>
		<?php echo $ddlCategory?>
		</td>
	</tr>
	<tr>

		<td class="product">
		<div>
		<?php echo $this->lang->line('vi_name')?>
		</div>
		<input type="text" style="width: 260px; height:20px" class="text" name="txtViName" id="txtViName" value="<?php echo $product->vi_name?>" maxlength="100" />
		</td>
	</tr>
	<tr>

		<td class="product">
		<div>
		<?php echo lang('en_name')?>
		</div>
		<input type="text" style="width: 260px; height:20px" class="text" name="txtEnName" id="txtEnName" value="<?php echo $product->en_name?>" maxlength="100" />
		</td>
	</tr>
	<tr>

		<td class="product">
		<div>
		<?php echo lang('vi_description')?>
		</div>
		<?php
		echo  $this->ckeditor->editor("txtViDescription", $product->vi_description, $config) ;
		// echo fckEditor('txtViDescription', $product->vi_description);?>

		</td>
	</tr>
	<tr>

		<td class="product">
		<div>
		<?php echo lang('en_description')?>
		</div>
		<?php
			//$fckEditor->InstanceName = 'txtEnDescription';
			//$fckEditor->Value = $product->en_description;
			//echo $fckEditor->CreateHtml() ;
			//echo fckEditor('txtEnDescription', $product->en_description);
                        echo  $this->ckeditor->editor("txtEnDescription", $product->en_description, $config) ;
                ?>
		</td>
	</tr>
	<tr>

		<td class="product">
		<div>
		<?php echo lang('unit')?>
		</div>
		<select name="unit">
		<?php
			for($i = 0; $i < count($units); $i++){
				if($units[$i]->id == $product->id_unit)
					echo '<option selected value='.$units[$i]->id.'>'. $units[$i]->vi_name . '</option>';
				else
					echo '<option value='.$units[$i]->id.'>'. $units[$i]->vi_name . '</option>';
			}
		?>
		</select>
		</td>
	</tr>
	<tr>

		<td class="product">
		<div>
		<?php echo lang('source')?>
		</div>
		<select name="source">
		<?php
			for($i = 0; $i < count($sources); $i++){
				if($sources[$i]->id == $product->id_source)
					echo '<option selected="selected" value='.$sources[$i]->id.'>'. $sources[$i]->vi_name . '</option>';
				else
					echo '<option value='.$sources[$i]->id.'>'. $sources[$i]->vi_name . '</option>';
			}
		?>

		</select>
		</td>
	</tr>

	<tr>

		<td class="product">
		<div>
		<?php echo lang('provider')?>
		</div>
		<select name="provider">
		<?php
			for($i = 0; $i < count($providers); $i++){
				if($providers[$i]->id_provider == $product->id_provider)
					echo '<option selected="selected" value='.$providers[$i]->id_provider.'>'. $providers[$i]->vi_name . '</option>';
				else
					echo '<option value='.$providers[$i]->id_provider.'>'. $providers[$i]->vi_name . '</option>';
			}
		?>

		</select>
		</td>
	</tr>

	<tr>

		<td class="product">
		<div>
		<?php echo lang('quantity')?>
		</div>
		<input type="text" style="width: 160px; height:20px" class="text" name="txtQuantity" id="txtQuantity" value="<?php echo $product->quantity?>" maxlength="200" />
		</td>
	</tr>
	<tr>

		<td class="product">
		<div>
		<?php echo lang('price')?>
		</div>
		<input type="text" style="width: 160px; height:20px" class="text" name="txtPrice" id="txtPrice" value="<?php echo $product->price?>" maxlength="200" />
		</td>
	</tr>
	<tr>

		<td class="product">
		<div>
		<?php echo lang('image')?>
		</div>
		<?php
		if($product->image!='' OR $product->image!=null)
			echo '<img src="'.$this->base_url.$product->image.'" height=90 width=90><br>';
		?>
		<input type="file" style="width: 160px; height:20px" name="file" id="file"/>
		</td>
	</tr>

	<tr>
		<td class="product">

		<?php echo lang('best_sell_product')?>

		<input type="checkbox" class="checkbox" <?php echo $product->best_sell==1? 'checked' : ''?> name="bestSell" value="1" />
		&nbsp;&nbsp;&nbsp;&nbsp;

        <?php echo lang('special_product')?>

		<input type="checkbox" class="checkbox" <?php echo $product->special==1? 'checked' : ''?> name="special" value="1" />
		&nbsp;&nbsp;&nbsp;&nbsp;

		<?php echo lang('active')?>
		<input type="checkbox" class="checkbox" <?php echo $product->active==1? 'checked' : ''?> name="active" value="1" />
		</td>
	</tr>

	<tr>

		<td class="product">
		<?php echo lang('indicates_a_required_field');?>
 		</td>
	</tr>

</table>
<input type="hidden" name="txtID" id="txtID" value="<?php echo $product->id_product?>"/>
<p> <input type="submit" class="submit button" name="btSave" value="<?php echo lang('save')?>" /> </p>
</form>

 </div>